#include<bits/stdc++.h>
using namespace std;
const int maxn = 100006;
int n, m;
long long a[maxn];
long long diff[maxn];
int main() {
  cin>>n>>m;
  for(int i=1; i<=n; ++i) cin>>a[i];
  while(m--) {
    int l, r, c; cin>>l>>r>>c;
    diff[l] += c;
    diff[r+1] -= c;
  }
  int now = 0;
  for(int i=1; i<=n; ++i) {
    now+=diff[i];
    cout<<now + a[i]<<' ';
  }
  cout << endl;
}
